#!/bin/bash
#
#
# build package
#
#
env=$1
if [ -z "$env" ]; then
    echo "================================="
    echo "Error: env param not found. "
    echo "Please run script like: ./build.sh dev / ./build.sh prod"
    echo "================================="
else
    echo "================================="
    echo "start package, environment: "$env
    echo "================================="
    if [ -z "$JAVA_HOME" ]; then
       echo "Error: JAVA_HOME not found in your environment."
    elif [ -z "$MAVEN_HOME" ]; then
       echo "Error: MAVEN_HOME not found in your environment."
    else
       mvn clean package -DskipTests=true -P $env
    fi
fi


echo "================================="
echo "end package."
echo "================================="